/***********************************************************************
* @file systemTime
* Description:
*
**********************************************************************
* File name:      systemTime.c
* Date:           2022-11-23
* Version:        V1.0
* Author          KongYao
* @history:
* V1.0 创建文件
***********************************************************************/
#include "systemTime.h"



volatile static uint32_t system_ms = 0;

/**
  * @brief  get ms counter from power on
  * @param  none
  * @retval system ms
  */
uint32_t millis(void)
{
    return system_ms;
}

/*************************************************************
** Function name:       TimeFrame_TIMECNT
** Descriptions:        放在1ms的中断里 计时使用
** Input parameters:    None
** Output parameters:   None
** Returned value:      None
** Remarks:             None
*************************************************************/
void TimeFrame_TIMECNT(void){
	system_ms ++;
}


/*************************************************************
** Function name:       TimeFram_Delayms
** Descriptions:        ms延时程序
** Input parameters:    None
** Output parameters:   None
** Returned value:      None
** Remarks:             None
*************************************************************/
void TimeFram_Delayms(uint16_t ms){
  uint32_t curTime = system_ms;
  while (1)
  {
    if (system_ms - curTime >= ms){
      break;
    }
  }
}






